set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 10.0)

add_definitions(-D_DISABLE_VECTOR_ANNOTATION)
add_definitions(-D_DISABLE_STRING_ANNOTATION)

set(BUILD_TESTING OFF CACHE BOOL "")
set(LIBUV_BUILD_SHARED OFF CACHE BOOL "")
set(WITH_LIBSODIUM OFF CACHE BOOL "")
set(WITH_LIBBSD OFF CACHE BOOL "")
set(BUILD_TESTS OFF CACHE BOOL "")
set(ZMQ_HAVE_IPC OFF CACHE BOOL "")
set(WITH_DOCS OFF CACHE BOOL "")
set(ENABLE_DRAFTS OFF CACHE BOOL "")
set(BUILD_SHARED OFF CACHE BOOL "")
set(ENABLE_CLANG OFF CACHE BOOL "")

set(CURL_TARGET_WINDOWS_VERSION "0x0600" CACHE STRING "")
set(BUILD_CURL_EXE OFF CACHE BOOL "")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
set(CURL_DISABLE_INSTALL ON CACHE BOOL "")
set(CURL_ENABLE_EXPORT_TARGET OFF CACHE BOOL "")
set(CURL_DISABLE_HEADERS_API ON CACHE BOOL "")
set(CURL_DISABLE_BINDLOCAL ON CACHE BOOL "")
set(BUILD_LIBCURL_DOCS OFF CACHE BOOL "")
set(BUILD_MISC_DOCS OFF CACHE BOOL "")
set(ENABLE_CURL_MANUAL OFF CACHE BOOL "")
set(CURL_ZLIB OFF CACHE BOOL "")
set(CURL_BROTLI OFF CACHE BOOL "")
set(CURL_ZSTD OFF CACHE BOOL "")
set(CURL_DISABLE_ALTSVC ON CACHE BOOL "")
set(CURL_DISABLE_COOKIES ON CACHE BOOL "")
set(CURL_DISABLE_DOH ON CACHE BOOL "")
set(CURL_DISABLE_GETOPTIONS ON CACHE BOOL "")
set(CURL_DISABLE_HSTS ON CACHE BOOL "")
set(CURL_DISABLE_LIBCURL_OPTION ON CACHE BOOL "")
set(CURL_DISABLE_MIME ON CACHE BOOL "")
set(CURL_DISABLE_NETRC ON CACHE BOOL "")
set(CURL_DISABLE_NTLM ON CACHE BOOL "")
set(CURL_DISABLE_PARSEDATE ON CACHE BOOL "")
set(CURL_DISABLE_PROGRESS_METER ON CACHE BOOL "")
set(CURL_DISABLE_SHUFFLE_DNS ON CACHE BOOL "")
set(CURL_DISABLE_SOCKETPAIR ON CACHE BOOL "")
set(CURL_DISABLE_VERBOSE_STRINGS ON CACHE BOOL "")
set(CURL_DISABLE_WEBSOCKETS ON CACHE BOOL "")
set(HTTP_ONLY ON CACHE BOOL "")
set(CURL_ENABLE_SSL OFF CACHE BOOL "")
set(USE_LIBIDN2 OFF CACHE BOOL "")
set(CURL_USE_LIBPSL OFF CACHE BOOL "")
set(CURL_USE_LIBSSH2 OFF CACHE BOOL "")
set(ENABLE_UNIX_SOCKETS OFF CACHE BOOL "")
set(CURL_DISABLE_TESTS ON CACHE BOOL "")
set(USE_NGHTTP2 OFF CACHE BOOL "")
set(BUILD_EXAMPLES OFF CACHE BOOL "")
set(CURL_DISABLE_SRP ON CACHE BOOL "")
set(CURL_STATIC_CRT ON CACHE BOOL "")

if (WITH_TLS)
	set(P2POOL_BORINGSSL ON CACHE BOOL "")
	set(OPENSSL_INCLUDE_DIR "../grpc/third_party/boringssl-with-bazel/src/include" CACHE STRING "")
endif()

add_subdirectory(../external/src/curl curl)
add_subdirectory(../external/src/libuv libuv)
add_subdirectory(../external/src/libzmq libzmq)

set(CURL_LIBRARY_DEBUG libcurl_static)
set(CURL_LIBRARY libcurl_static)

set(UV_LIBRARY_DEBUG uv_a)
set(UV_LIBRARY uv_a)

set(ZMQ_LIBRARY_DEBUG libzmq-static)
set(ZMQ_LIBRARY libzmq-static)
